/**
 * Copyright (c) 2023 OceanBase
 * OceanBase CE is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#include "fb303_types.h"

#include <algorithm>
#include <ostream>

#include <thrift/TToString.h>

namespace facebook { namespace fb303 {

int _kfb_statusValues[] = {
  fb_status::DEAD,
  fb_status::STARTING,
  fb_status::ALIVE,
  fb_status::STOPPING,
  fb_status::STOPPED,
  fb_status::WARNING
};
const char* _kfb_statusNames[] = {
  "DEAD",
  "STARTING",
  "ALIVE",
  "STOPPING",
  "STOPPED",
  "WARNING"
};
const std::map<int, const char*> _fb_status_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kfb_statusValues, _kfb_statusNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr));

std::ostream& operator<<(std::ostream& out, const fb_status::type& val) {
  std::map<int, const char*>::const_iterator it = _fb_status_VALUES_TO_NAMES.find(val);
  if (it != _fb_status_VALUES_TO_NAMES.end()) {
    out << it->second;
  } else {
    out << static_cast<int>(val);
  }
  return out;
}

std::string to_string(const fb_status::type& val) {
  std::map<int, const char*>::const_iterator it = _fb_status_VALUES_TO_NAMES.find(val);
  if (it != _fb_status_VALUES_TO_NAMES.end()) {
    return std::string(it->second);
  } else {
    return std::to_string(static_cast<int>(val));
  }
}

}} // namespace
